<?php include 'header.php';?>

<?php
$id = $_REQUEST["loginid"];
$pwd = $_REQUEST["loginpwd"];

$conn = mysql_connect("localhost", "root", "643313") or die(mysql_error());
mysql_select_db("regist_sys");

$sql = "SELECT * FROM account WHERE id='$id' AND password='$pwd'";
$result = mysql_query($sql,$conn) or die(mysql_error());

if ($row = mysql_fetch_assoc($result)) {
	echo <<< HERE
<div id="sidebar">
Welcome back!
</div>
HERE;
} else {
	echo <<< HERE
<div id="sidebar">
ID is invalid, you should register first!
<p><a href="index.php"><span
			onMouseOver="this.style.textDecoration='underline';"
			onMouseout="this.style.textDecoration='none';"><font color="#FF000">Register Here</font></span></a></p>
</div>
HERE;
}
?>
<?php include 'content.php';?>
<?php include 'footer.php';?>